<?php
namespace Home\Controller;
use Think\Controller;
class StudentController extends Controller {

    public function index(){
    	if($_POST){
	    	$student = array(
	    		's_name'=>I('post.UserName'),
	    		'tel'=>I('post.tel')
	    		);
	    	$id = D('Student')->add($student);
	    	// 把所有的题目设置成没有做过
	    	M('Question')->where('1=1')->setField('idRead', 0);
	    	$this->redirect('Question/index',array('student_id' => $id), 0, '页面跳转中...');
	    }
        $this->display('login');
    }


}